
/** 메뉴>메뉴관리 를 호출되어지는 데이터 처리 Controller                                
* @FileName  : MenuController.java 0.1 2014년09월12일(14:05:50)       
* @Project     : nComz n-eip 프로젝트   
* @Date         : 2014년09월12일(14:05:50)          
* @작성자      : 신용천(nComz)           	  
* @변경이력 :                         
* @프로그램 설명 :메뉴>메뉴관리(Controller)    
* Copyright 2012 (주)nComz Cop. All rights Reserved.                  
*/ 

package com.sunny.hp.menu; 

import java.util.ArrayList; 
import java.util.LinkedHashMap; 
import java.util.LinkedList; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.stereotype.Controller; 
import org.springframework.web.bind.annotation.RequestMapping; 
import org.springframework.web.servlet.view.json.MappingJacksonJsonView; 
import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.sunny.hp.common.vo.*;
import com.sunny.hp.menu.service.MenuService; 
import com.sunny.hp.common.servlet.ModelAndNCOMZView; 
import com.sunny.hp.common.util.HttpRequest; 

/** 메뉴>메뉴관리 를 호출되어지는 데이터 처리 Controller                               
* @ClassName  : MenuController       
* @Date         : 2014년09월12일(14:05:50)         
* @작성자      : 신용천(nComz)           	 
* @변경이력 :                        
* @프로그램 설명 :메뉴>메뉴관리(Controller)                     
*/      

@Controller
@RequestMapping("/menu")
public class MenuController {

	@Autowired
	private MenuService menuService; 
	protected final Log logger = LogFactory.getLog(getClass());

	/**  메뉴>메뉴관리>메뉴관리 화면 					
	* @Method Name  : selectMenuView   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴관리 화면                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/selectMenuView.do")
	public ModelAndNCOMZView selectMenuView(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request);
	mav.setViewName("menu/selectMenuView");

	return mav;
	}


	/**  메뉴>메뉴관리>메뉴리스트 가져오기 					
	* @Method Name  : selectMenuList   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴리스트 가져오기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/selectMenuList.do")
	public ModelAndNCOMZView selectMenuList(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	ArrayList<LinkedHashMap> retList1 = new ArrayList<LinkedHashMap>();
	try {
		retList1 = (ArrayList<LinkedHashMap>)menuService.selectMenuList(param);
		mav.addObject("retList1", retList1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  메뉴>메뉴관리>하위 메뉴 리스트 가져오기 					
	* @Method Name  : selectSubMenuList   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 하위 메뉴 리스트 가져오기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/selectSubMenuList.do")
	public ModelAndNCOMZView selectSubMenuList(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	ArrayList<LinkedHashMap> retList1 = new ArrayList<LinkedHashMap>();
	try {
		retList1 = (ArrayList<LinkedHashMap>)menuService.selectSubMenuList(param);
		mav.addObject("retList1", retList1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  메뉴>메뉴관리>메뉴 정보 가져오기 					
	* @Method Name  : selectMenuInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴 정보 가져오기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/selectMenuInfo.do")
	public ModelAndNCOMZView selectMenuInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	LinkedHashMap resultMap1 = new LinkedHashMap(); 
	try {
		resultMap1 = menuService.selectMenuInfo(param);
		mav.addObject("resultMap1", resultMap1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  메뉴>메뉴관리>메뉴 등록하기 					
	* @Method Name  : insertMenuInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴 등록하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/insertMenuInfo.do")
	public ModelAndNCOMZView insertMenuInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	try {
		resultInt1 = menuService.insertMenuInfo(param);
		mav.addObject("resultInt1", resultInt1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  메뉴>메뉴관리>메뉴 수정하기 					
	* @Method Name  : updateMenuInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴 수정하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/updateMenuInfo.do")
	public ModelAndNCOMZView updateMenuInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	try {
		resultInt1 = menuService.updateMenuInfo(param);
		mav.addObject("resultInt1", resultInt1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}


	/**  메뉴>메뉴관리>메뉴 삭제하기 					
	* @Method Name  : deleteMenuInfo   		
	* @작성일   : 2014년09월12일(14:05:50)                    		
	* @작성자   : 신용천(nComz)                    		
	* @변경이력  :                           		
	* @Method 설명 : 메뉴 삭제하기                         		
	* @param request HttpServletRequest
	* @param response HttpServletResponse
	* @return mav                                	
	*/
 	@RequestMapping(value="/ajax/deleteMenuInfo.do")
	public ModelAndNCOMZView deleteMenuInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
			ModelAndNCOMZView mav   	= new ModelAndNCOMZView(request,new MappingJacksonJsonView());
	HttpRequest requestUtil = new HttpRequest(request); 
	LinkedHashMap param = requestUtil.paramBind(); 
	int resultInt1 = 0;
	try {
		resultInt1 = menuService.deleteMenuInfo(param);
		mav.addObject("resultInt1", resultInt1); 
		} catch (Exception e) {
			e.printStackTrace(); 
		} 

	return mav;
	}

}
